package com.hjq.demo.widget

import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView

class PriceDivi : RecyclerView.ItemDecoration() {
    val space = 10;
    override fun getItemOffsets(
        outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State
    ) {
//        super.getItemOffsets(outRect, view, parent, state)
        if (parent.getChildLayoutPosition(view) !== 0) {
            outRect.top = space;
        }
        if (parent.getChildLayoutPosition(view) !== state.itemCount - 1) {
            outRect.bottom = space;
        }
    }
}